//
//  InfoViewController.m
//  CulinaryKnowledge
//
//  Created by CaoHung on 7/16/14.
//  Copyright (c) 2014 GreenSun. All rights reserved.
//

#import "InfoViewController.h"

#define IS_OS_7    ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)

@interface InfoViewController ()

@end

@implementation InfoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title = @"アプリ情報";
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"backgroundIUCN.png"]];
    
    if (!IS_OS_7) {
        CGRect frame = self.myViewInfo.frame;
        frame.origin.y = frame.origin.y - 64.0f;
        
        self.myViewInfo.frame = frame;
    }
}

- (void)viewDidAppear:(BOOL)animated
{
    //Show navigationController
    self.navigationController.navigationBarHidden = NO;
}

- (void)viewWillDisappear:(BOOL)animated
{
    //Hide navigationController
    self.navigationController.navigationBarHidden = YES;
}

// Go to shogakukan
- (IBAction)goToShop1:(id)sender {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.shogakukan.co.jp/"]];
}

- (IBAction)goToShop2:(id)sender {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.shogakukan.co.jp/"]];
}

// Go to dnamedia.co.jp
- (IBAction)goToDnamedia:(id)sender {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.dnamedia.co.jp/"]];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
